import { px } from "../px"
import { baseEchartsOptions } from "./base-echarts-options"

export const createChartsOptions = (options) => {
    const result = {
        ...baseEchartsOptions,
        ...options
    }
    if (!(options?.xAxis?.axisLabel?.fontSize)) {
        options.xAxis = options.xAxis || {}
        options.xAxis.axisLabel = options.xAxis.axisLabel || {}
        options.xAxis.axisLabel.fontSize = px(12)
    }
    if (!(options?.yAxis?.axisLabel?.fontSize)) {
        options.yAxis = options.yAxis || {}
        options.yAxis.axisLabel = options.yAxis.axisLabel || {}
        options.yAxis.axisLabel.fontSize = px(12)
    }
    return result
}